<?php
include_once "Db.class.php";//引入封装好的PDO Db类
$db=new Db('127.0.0.1','week','root','root');//连接
$data=$db->showAll('shop',"shopname='联想'");//查询全部方法
print_r($data);//展示出购物车中的商品信息
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<center>
    <!--    展示出购物车中的商品图片，库存，价格标红-->
    <?php foreach($data as $key => $value){
        echo "<p><input type='radio'>
                 <img src='$value[photo]' width='100px' height='100px' alt=''>
                 <font>$value[shopname]</font>
                 <font color='red'>$value[price]</font>
                 <font>$value[count]</font>
                 </p>";
    }?>
</center>
</body>
</html>
